import request from '@/utils/request'

// 获取选课列表
export function getEnrollmentList(params) {
  return request({
    url: '/enrollment/list',
    method: 'get',
    params
  })
}

// 学生选课
export function selectCourse(data) {
  return request({
    url: '/enrollment/select',
    method: 'post',
    params: data
  })
}

// 学生退课
export function dropCourse(data) {
  return request({
    url: '/enrollment/drop',
    method: 'post',
    params: data
  })
}

// 获取学生选项（只显示在校状态的学生）
export function getStudentOptions() {
  return request({
    url: '/student/list',
    method: 'get',
    params: { page: 0, size: 1000, status: '在校' }
  })
}

// 获取课程选项（只显示开设状态的课程）
export function getCourseOptions() {
  return request({
    url: '/course/list',
    method: 'get',
    params: { page: 0, size: 1000, status: '开设' }
  })
}
